﻿using NUnit.Framework;

namespace Simhopp.Common
{
    /// <summary>
    /// Test class of the HeadJudge class.
    /// </summary>
    [TestFixture]
    public class TestHeadJudge
    {
        #region FIELD REGION

        private User defaultHeadJudge;
        private User headJudge;

        #endregion
        #region TEST METHOD REGION
        [SetUp]
        public void Init()
        {
            defaultHeadJudge = new User();
            headJudge = new User
            {
                UserName = "ankan155",
                Name = "Majvor Gunnarsson",
                Gender = Genders.Female,
                Age = 22,
                Nationality = "USA",
                SocialSecurityNumber = "19910506",
                AccountType = AccountTypes.HeadJudge,
                HasSubmittedScore = true
            };
        }

        [Test]
        public void TestConstructors()
        {
            Assert.AreEqual("ankan155", headJudge.UserName);
            Assert.AreEqual("Majvor Gunnarsson", headJudge.Name);
            Assert.AreEqual(Genders.Female, headJudge.Gender);
            Assert.AreEqual(22, headJudge.Age);
            Assert.AreEqual("USA", headJudge.Nationality);
            Assert.AreEqual("19910506", headJudge.SocialSecurityNumber);
            Assert.AreEqual(AccountTypes.HeadJudge, headJudge.AccountType);
            Assert.AreEqual(true, headJudge.HasSubmittedScore);

            Assert.AreEqual("", defaultHeadJudge.UserName);
            Assert.AreEqual("", defaultHeadJudge.Name);
            Assert.AreEqual(Genders.Male, defaultHeadJudge.Gender);
            Assert.AreEqual(0, defaultHeadJudge.Age);
            Assert.AreEqual("", defaultHeadJudge.Nationality);
            Assert.AreEqual("", defaultHeadJudge.SocialSecurityNumber);
            Assert.AreEqual(AccountTypes.NoAccess, defaultHeadJudge.AccountType);
            Assert.AreEqual(false, defaultHeadJudge.HasSubmittedScore);
        }

        [Test]
        public void TestProperties()
        {
            defaultHeadJudge.UserName = "bävern33";
            defaultHeadJudge.Name = "Klas Klättermus";
            defaultHeadJudge.Gender = Genders.Male;
            defaultHeadJudge.Age = 16;
            defaultHeadJudge.Nationality = "Jamaica";
            defaultHeadJudge.SocialSecurityNumber = "199412117584";
            defaultHeadJudge.AccountType = AccountTypes.Administrator;
            defaultHeadJudge.HasSubmittedScore = true;

            Assert.AreEqual("bävern33", defaultHeadJudge.UserName);
            Assert.AreEqual("Klas Klättermus", defaultHeadJudge.Name);
            Assert.AreEqual(Genders.Male, defaultHeadJudge.Gender);
            Assert.AreEqual(16, defaultHeadJudge.Age);
            Assert.AreEqual("Jamaica", defaultHeadJudge.Nationality);
            Assert.AreEqual("199412117584", defaultHeadJudge.SocialSecurityNumber);
            Assert.AreEqual(AccountTypes.Administrator, defaultHeadJudge.AccountType);
            Assert.AreEqual(true, defaultHeadJudge.HasSubmittedScore);
        }

        [TearDown]
        public void Terminate()
        {

        }
        #endregion
    }
}
